package cn.iocoder.yudao.module.system.convert.userdetail;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;

import cn.iocoder.yudao.framework.ip.core.utils.AreaUtils;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import cn.iocoder.yudao.module.system.controller.admin.userdetail.vo.*;
import cn.iocoder.yudao.module.system.dal.dataobject.userdetail.UserDetailDO;

/**
 * 艾灸师详情 Convert
 *
 * @author 曹建伟
 */
@Mapper
public interface UserDetailConvert {

    UserDetailConvert INSTANCE = Mappers.getMapper(UserDetailConvert.class);

    UserDetailDO convert(UserDetailCreateReqVO bean);

    UserDetailDO convert(UserDetailUpdateReqVO bean);


    default UserDetailRespVO convert(UserDetailDO bean) {
        if ( bean == null ) {
            return null;
        }

        UserDetailRespVO userDetailRespVO = new UserDetailRespVO();

        userDetailRespVO.setUserId( bean.getUserId() );
        userDetailRespVO.setPicUrl( bean.getPicUrl() );
        userDetailRespVO.setMobile( bean.getMobile() );
        userDetailRespVO.setLearnTime( bean.getLearnTime() );
        userDetailRespVO.setRealName( bean.getRealName() );
        userDetailRespVO.setIdNumber( bean.getIdNumber() );
        userDetailRespVO.setIdFront( bean.getIdFront() );
        userDetailRespVO.setIdBack( bean.getIdBack() );
        userDetailRespVO.setAddress( bean.getAddress() );
        userDetailRespVO.setAreaId( bean.getAreaId() );
        userDetailRespVO.setId( bean.getId() );
        userDetailRespVO.setCreateTime( bean.getCreateTime() );
        userDetailRespVO.setAreaName(AreaUtils.format(bean.getAreaId()));

        return userDetailRespVO;
    }

    List<UserDetailRespVO> convertList(List<UserDetailDO> list);

    PageResult<UserDetailRespVO> convertPage(PageResult<UserDetailDO> page);

    List<UserDetailExcelVO> convertList02(List<UserDetailDO> list);

}
